<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Buat Akun</title>
<link rel="stylesheet" href="css/style_login.css" type="text/css"/>
<link type="text/css" href="css/excite-bike/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script>
<style type="text/css">
.right {
	float:right
}
button {margin: 0; padding: 0;}
button {margin: 2px; position: relative; padding: 4px 4px 4px 2px; 
cursor: pointer; float: left;  list-style: none;}
button span.ui-icon {float: left; margin: 0 4px;}
</style>
</head>
<body>
<form name="login" action="" method="POST"">
<div class="login-inside">
<div class="login-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center">
<table cellpadding="0" cellspacing="0">
<tr>
<td height="25">Username</td>
<td>&nbsp;:&nbsp;<input type="text" name="username"  class="text" id="username" /></td>
</tr>
<tr>
<td height="26">Password</td>
<td>&nbsp;:&nbsp;<input type="password" class="text" name="password" id="password" /></td>
</tr>
<tr>
<td colspan="2">
<div class="right">
<a href="index.php"><button type="button" name="submit" class="ui-state-default ui-corner-all" id="icon"></span>Batal</button></a>
<button type="submit" name="submit" class="ui-state-default ui-corner-all" id="icon"></span>Buat Akun</button>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</div>
</form>
<?php
mysql_connect('localhost','root','');
mysql_select_db('administrasi15');

if(isset($_POST['submit'])){
	$user=$_POST['username'];
	$password=md5($_POST['password']);
	$masuk=mysql_query("INSERT INTO users VALUES('$user','$password')");
			if($masuk){
				echo "<script>alert('Akun berhasil dibuat')</script>";
				echo "<script>window.location = 'index.php'</script>";
			}else{
				echo "<script>alert('Akun gagal dibuat')</script>";
				echo "<script>window.location = 'index.php'</script>";
			}

}
?>
</body>
</html>